package all

import "log"

// Device 接收者
type Device interface {
	On()
	Off()
}

// Tv 电视操作
type Tv struct {
	IsRunning bool
}

func (t *Tv) On() {
	t.IsRunning = true
	log.Print(t.IsRunning, "on")
}

func (t *Tv) Off() {
	t.IsRunning = false
	log.Print(t.IsRunning, "off")
}

// Control 遥控器
type Control struct {
	IsOpenTv bool
}

func (c *Control) On() {
	c.IsOpenTv = true
}
func (c *Control) Off() {
	c.IsOpenTv = false
}
